x86: map M2P table sparsely
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Sep 2009 07:19:16 +0000 (08:19 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Sep 2009 07:19:16 +0000 (08:19 +0100)
commit78e09264ad9836fa47610399e4a5b4d3cd62caf5
tree0d345cc1a0c3988dbdf8681ad6cce6cd81fca4b1
parent73f0173619a0017225fc185ed1a96a1a47a8a0c3
x86: map M2P table sparsely

Avoid backing M2P table holes with memory, when those holes are large
enough to cover an exact multiple of large pages.

For the sake of saving and migrating guests, XENMEM_machphys_mfn_list
fills the holes in the array it returns with the MFN for the previous
range returned (thanks to Keir pointing out that it really doesn't
matter *what* MFN gets returned for invalid ranges). Using the most
recently encountered MFN (rather than e.g. always the first one)
represents an attempt to cut down on the number of references these
pages will get when they get mapped into a privileged domain's address
space.

This also allows for saving a couple of 2M pages even on certain
"normal" systems.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/x86_32/mm.c
xen/arch/x86/x86_64/compat/mm.c
xen/arch/x86/x86_64/mm.c